package 面向对象_中.a继承.练习2圆的面积;

/**
 * @Projectname java_based
 * @Filename Cylinder
 * @Author an
 * @Data 2022/6/29 21:40
 * @Description TODO
 */
/*
        cylinder（圆柱）
* -length:double
Cylinder(): 构造器,将length属性初始化为1
+setLength(double length):void
+getLength():double
+findVolume() :double 计算圆柱体积*/
public class Cylinder extends Circle{

    private double length;

    public Cylinder(){
        length = 1.0;
    }

    public double getLength() {
        return length;
    }

    public void setLength(double length) {
        this.length = length;
    }

    public double findVolume(){	//计算圆柱体积
        return findArea() * length;
    }
}
